//字符串 "" 或 ''
let name = "along";
let sex = "男";
let person = "\"" + name + "\"" + "'" + sex + "'";
let person2 = `"${name}"'${sex}'`;
console.log(person,person2);

// 模板字符串
let name = "along";
let sex = "男";
let person2 = '"${name}"\'${sex}\'';
person2 = person2.replace(/\$\{([^}]+)\}/g,()=>{
    return eval(arguments[1])
})
console.log(person2)

let arr2 = ["alone","男"];
let newArr = arr2.map(item=>{
    return  `<li>${item}</li>`
});
let domHTML = `<ul>${newArr.join("")}</ul>`;
console.log(domHTML)

let name = "along";
let sex = "男";
function fn(arr,...arguments){
    console.log(arr)
    let str = "";
    for(let i=0;i<arguments.length;i++){
        str +=(arr[i]+arguments[i]+"@");
    }
    return str;
}
let str = fn`名字是：${name}性别${sex}`;
console.log(str)

// includes(是否包含指定值) 
// startsWith(用于检测字符串是否以指定的前缀开始) 
// endsWith (用于检测字符串是否以指定的后缀结束)
// padStart(字符串头部补全长度)   -- x.padStart(2,0)   x前面加0，长度一共为2  => 0x
// padEnd(字符串尾部补全长度)     -- x.padEnd(2,0)  x后面加0，长度一共为2  => x0
console.log("asasda".includes("jea222"));
console.log("3".padEnd(2,0))  